import type { FormInstance } from 'element-plus'

export const FormValid = (formRef:FormInstance)=>{
    return new Promise((res,rej)=>{
        formRef.validate((valid, fields) => {
          if (valid) {
            console.log('校验成功');
            res(true);
          } else {
            rej(new Error('校验失败'));
          }
        })
    })
}